import 'package:rfid/generated/json/base/json_field.dart';
import 'package:rfid/generated/json/inventory_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class InventoryEntity {

	int? count;
	List<InventoryList>? list;
  
  InventoryEntity();

  factory InventoryEntity.fromJson(Map<String, dynamic> json) => $InventoryEntityFromJson(json);

  Map<String, dynamic> toJson() => $InventoryEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class InventoryList {

	String? reader;
	String? epc;
  @JSONField(name: "block_data")
	String? blockData;
	dynamic pc;
	dynamic tid;
	@JSONField(name: "scan_count")
	int? scanCount;
	List<InventoryListAnts>? ants;
  
  InventoryList();

  factory InventoryList.fromJson(Map<String, dynamic> json) => $InventoryListFromJson(json);

  Map<String, dynamic> toJson() => $InventoryListToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class InventoryListAnts {

	int? no;
	int? rssi;
	int? count;
  
  InventoryListAnts();

  factory InventoryListAnts.fromJson(Map<String, dynamic> json) => $InventoryListAntsFromJson(json);

  Map<String, dynamic> toJson() => $InventoryListAntsToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}